home *** CD-ROM | disk | FTP | other *** search
/ An Invitation to the Roland World of Music / Roland - An Invitation To The Roland World Of Music.bin / vb / cooltool / piano / piano2.frm < prev    next >
Text File  |  1995-04-21  |  49KB  |  1,519 lines

  1. VERSION 2.00
  2. Begin Form Piano 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "MIDI CoolTools - Piano"
  6.    Height          =   2355
  7.    Icon            =   PIANO2.FRX:0000
  8.    Left            =   45
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   1665
  12.    ScaleWidth      =   9330
  13.    Top             =   1530
  14.    Width           =   9450
  15.    Begin Frame Frame1 
  16.       BackColor       =   &H00C0C0C0&
  17.       Height          =   915
  18.       Left            =   -30
  19.       TabIndex        =   8
  20.       Top             =   0
  21.       Width           =   9375
  22.       Begin ComboBox ComboPatch 
  23.          BackColor       =   &H00000000&
  24.          FontBold        =   0   'False
  25.          FontItalic      =   0   'False
  26.          FontName        =   "MS Sans Serif"
  27.          FontSize        =   8.25
  28.          FontStrikethru  =   0   'False
  29.          FontUnderline   =   0   'False
  30.          ForeColor       =   &H0000FF00&
  31.          Height          =   300
  32.          Left            =   5460
  33.          Style           =   2  'Dropdown List
  34.          TabIndex        =   5
  35.          Top             =   510
  36.          Width           =   2295
  37.       End
  38.       Begin Knob KnobPan 
  39.          BackColor       =   &H00C0C0C0&
  40.          BevelWidth      =   2
  41.          BorderWidth     =   0
  42.          FontBold        =   0   'False
  43.          FontItalic      =   0   'False
  44.          FontName        =   "Small Fonts"
  45.          FontSize        =   5.25
  46.          FontStrikethru  =   0   'False
  47.          FontUnderline   =   0   'False
  48.          Height          =   600
  49.          Indicator       =   1  'Line
  50.          IndicatorColor  =   &H000000FF&
  51.          IndicatorWidth  =   0
  52.          KnobColor       =   &H00C0C0C0&
  53.          KnobStyle       =   3  'Textured
  54.          Left            =   8160
  55.          LinkControl     =   ""
  56.          LinkProperty    =   ""
  57.          Max             =   127
  58.          Min             =   0
  59.          Radius          =   240
  60.          TickCaptionColor=   &H00000000&
  61.          TickCaptions    =   PIANO2.FRX:0302
  62.          TickColor       =   &H00000000&
  63.          TickCount       =   0
  64.          TickGap         =   1
  65.          TickLength      =   4
  66.          TickWidth       =   1
  67.          Top             =   300
  68.          Value           =   1
  69.          Width           =   855
  70.       End
  71.       Begin HSlider HSliderMIDIChannel 
  72.          BackColor       =   &H00C0C0C0&
  73.          BevelInner      =   0  'None
  74.          BevelOuter      =   0  'None
  75.          BevelWidth      =   1
  76.          BorderWidth     =   1
  77.          Gap             =   3
  78.          Height          =   315
  79.          LargeChange     =   2
  80.          Left            =   90
  81.          LinkControl     =   ""
  82.          LinkProperty    =   ""
  83.          Max             =   15
  84.          Min             =   0
  85.          ThumbHeight     =   245
  86.          ThumbStyle      =   1  'Pointed Up
  87.          ThumbWidth      =   200
  88.          TickColor       =   &H00000000&
  89.          TickCount       =   16
  90.          TickLength      =   4
  91.          TickMarks       =   1  'Top
  92.          TickWidth       =   1
  93.          Top             =   570
  94.          TrackBevel      =   1  'Raised
  95.          TrackWidth      =   3
  96.          Value           =   1
  97.          Width           =   1665
  98.       End
  99.       Begin HSlider HSliderVolume 
  100.          BackColor       =   &H00C0C0C0&
  101.          BevelInner      =   0  'None
  102.          BevelOuter      =   0  'None
  103.          BevelWidth      =   1
  104.          BorderWidth     =   1
  105.          Gap             =   3
  106.          Height          =   315
  107.          LargeChange     =   2
  108.          Left            =   2160
  109.          LinkControl     =   ""
  110.          LinkProperty    =   ""
  111.          Max             =   127
  112.          Min             =   0
  113.          ThumbHeight     =   245
  114.          ThumbStyle      =   3  'Lined
  115.          ThumbWidth      =   320
  116.          TickColor       =   &H00000000&
  117.          TickCount       =   5
  118.          TickLength      =   4
  119.          TickMarks       =   0  'No Tick Marks
  120.          TickWidth       =   1
  121.          Top             =   570
  122.          TrackBevel      =   1  'Raised
  123.          TrackWidth      =   3
  124.          Value           =   1
  125.          Width           =   1275
  126.       End
  127.       Begin HSlider HSliderOctave 
  128.          BackColor       =   &H00C0C0C0&
  129.          BevelInner      =   0  'None
  130.          BevelOuter      =   0  'None
  131.          BevelWidth      =   1
  132.          BorderWidth     =   1
  133.          Gap             =   3
  134.          Height          =   315
  135.          LargeChange     =   2
  136.          Left            =   3900
  137.          LinkControl     =   ""
  138.          LinkProperty    =   ""
  139.          Max             =   3
  140.          Min             =   0
  141.          ThumbHeight     =   245
  142.          ThumbStyle      =   1  'Pointed Up
  143.          ThumbWidth      =   200
  144.          TickColor       =   &H00000000&
  145.          TickCount       =   4
  146.          TickLength      =   4
  147.          TickMarks       =   1  'Top
  148.          TickWidth       =   1
  149.          Top             =   570
  150.          TrackBevel      =   1  'Raised
  151.          TrackWidth      =   3
  152.          Value           =   1
  153.          Width           =   1185
  154.       End
  155.       Begin Label Label5 
  156.          BackColor       =   &H00C0C0C0&
  157.          Caption         =   "L - Pan - R"
  158.          Height          =   255
  159.          Left            =   8130
  160.          TabIndex        =   9
  161.          Top             =   120
  162.          Width           =   1005
  163.       End
  164.       Begin Label MidiChannelOutLabel 
  165.          Alignment       =   2  'Center
  166.          BackColor       =   &H00000000&
  167.          Caption         =   "1"
  168.          FontBold        =   0   'False
  169.          FontItalic      =   0   'False
  170.          FontName        =   "MS Sans Serif"
  171.          FontSize        =   9.75
  172.          FontStrikethru  =   0   'False
  173.          FontUnderline   =   0   'False
  174.          ForeColor       =   &H0000FF00&
  175.          Height          =   255
  176.          Left            =   1350
  177.          TabIndex        =   0
  178.          Top             =   270
  179.          Width           =   405
  180.       End
  181.       Begin Label Label1 
  182.          BackColor       =   &H00C0C0C0&
  183.          Caption         =   "MIDI Channel"
  184.          Height          =   255
  185.          Left            =   120
  186.          TabIndex        =   1
  187.          Top             =   270
  188.          Width           =   1215
  189.       End
  190.       Begin Label Label2 
  191.          BackColor       =   &H00C0C0C0&
  192.          Caption         =   "Volume"
  193.          Height          =   255
  194.          Left            =   2160
  195.          TabIndex        =   2
  196.          Top             =   270
  197.          Width           =   675
  198.       End
  199.       Begin Label Label3 
  200.          BackColor       =   &H00C0C0C0&
  201.          Caption         =   "Octave"
  202.          Height          =   255
  203.          Left            =   3930
  204.          TabIndex        =   3
  205.          Top             =   270
  206.          Width           =   645
  207.       End
  208.       Begin Label LabelVolume 
  209.          Alignment       =   2  'Center
  210.          BackColor       =   &H00000000&
  211.          Caption         =   "100"
  212.          FontBold        =   0   'False
  213.          FontItalic      =   0   'False
  214.          FontName        =   "MS Sans Serif"
  215.          FontSize        =   9.75
  216.          FontStrikethru  =   0   'False
  217.          FontUnderline   =   0   'False
  218.          ForeColor       =   &H0000FF00&
  219.          Height          =   255
  220.          Left            =   2820
  221.          TabIndex        =   4
  222.          Top             =   270
  223.          Width           =   585
  224.       End
  225.       Begin Label Label4 
  226.          BackColor       =   &H00C0C0C0&
  227.          Caption         =   "Patch"
  228.          Height          =   255
  229.          Left            =   5460
  230.          TabIndex        =   6
  231.          Top             =   270
  232.          Width           =   645
  233.       End
  234.       Begin Label LabelOctave 
  235.          Alignment       =   2  'Center
  236.          BackColor       =   &H00000000&
  237.          Caption         =   "0"
  238.          FontBold        =   0   'False
  239.          FontItalic      =   0   'False
  240.          FontName        =   "MS Sans Serif"
  241.          FontSize        =   9.75
  242.          FontStrikethru  =   0   'False
  243.          FontUnderline   =   0   'False
  244.          ForeColor       =   &H0000FF00&
  245.          Height          =   255
  246.          Left            =   4560
  247.          TabIndex        =   7
  248.          Top             =   270
  249.          Width           =   405
  250.       End
  251.    End
  252.    Begin MIDIOutput MIDIOutput1 
  253.       DeviceID        =   0
  254.       Left            =   420
  255.       Top             =   2490
  256.       VolumeLeft      =   0
  257.       VolumeRight     =   0
  258.    End
  259.    Begin MIDIInput MIDIInput1 
  260.       DeviceID        =   0
  261.       Left            =   -60
  262.       MaxSysexSize    =   0
  263.       MessageEventEnable=   -1  'True
  264.       Top             =   2340
  265.    End
  266.    Begin Frame Frame3 
  267.       BackColor       =   &H00C0C0C0&
  268.       DragMode        =   1  'Automatic
  269.       Height          =   885
  270.       Left            =   60
  271.       MousePointer    =   1  'Arrow
  272.       TabIndex        =   10
  273.       Top             =   810
  274.       Width           =   9165
  275.       Begin Frame PianoKey 
  276.          BackColor       =   &H00000000&
  277.          DragMode        =   1  'Automatic
  278.          ForeColor       =   &H00000000&
  279.          Height          =   555
  280.          Index           =   63
  281.          Left            =   8800
  282.          MousePointer    =   10  'Up Arrow
  283.          TabIndex        =   74
  284.          Top             =   30
  285.          Width           =   165
  286.       End
  287.       Begin Frame PianoKey 
  288.          BackColor       =   &H00000000&
  289.          DragMode        =   1  'Automatic
  290.          ForeColor       =   &H00000000&
  291.          Height          =   555
  292.          Index           =   61
  293.          Left            =   8560
  294.          MousePointer    =   10  'Up Arrow
  295.          TabIndex        =   73
  296.          Top             =   30
  297.          Width           =   165
  298.       End
  299.       Begin Frame PianoKey 
  300.          BackColor       =   &H00000000&
  301.          DragMode        =   1  'Automatic
  302.          ForeColor       =   &H00000000&
  303.          Height          =   555
  304.          Index           =   58
  305.          Left            =   8080
  306.          MousePointer    =   10  'Up Arrow
  307.          TabIndex        =   72
  308.          Top             =   30
  309.          Width           =   165
  310.       End
  311.       Begin Frame PianoKey 
  312.          BackColor       =   &H00000000&
  313.          DragMode        =   1  'Automatic
  314.          ForeColor       =   &H00000000&
  315.          Height          =   555
  316.          Index           =   56
  317.          Left            =   7840
  318.          MousePointer    =   10  'Up Arrow
  319.          TabIndex        =   71
  320.          Top             =   30
  321.          Width           =   165
  322.       End
  323.       Begin Frame PianoKey 
  324.          BackColor       =   &H00000000&
  325.          DragMode        =   1  'Automatic
  326.          ForeColor       =   &H00000000&
  327.          Height          =   555
  328.          Index           =   54
  329.          Left            =   7600
  330.          MousePointer    =   10  'Up Arrow
  331.          TabIndex        =   70
  332.          Top             =   30
  333.          Width           =   165
  334.       End
  335.       Begin Frame PianoKey 
  336.          BackColor       =   &H00000000&
  337.          DragMode        =   1  'Automatic
  338.          ForeColor       =   &H00000000&
  339.          Height          =   555
  340.          Index           =   51
  341.          Left            =   7120
  342.          MousePointer    =   10  'Up Arrow
  343.          TabIndex        =   69
  344.          Top             =   30
  345.          Width           =   165
  346.       End
  347.       Begin Frame PianoKey 
  348.          BackColor       =   &H00000000&
  349.          DragMode        =   1  'Automatic
  350.          ForeColor       =   &H00000000&
  351.          Height          =   555
  352.          Index           =   49
  353.          Left            =   6880
  354.          MousePointer    =   10  'Up Arrow
  355.          TabIndex        =   68
  356.          Top             =   30
  357.          Width           =   165
  358.       End
  359.       Begin Frame PianoKey 
  360.          BackColor       =   &H00000000&
  361.          DragMode        =   1  'Automatic
  362.          ForeColor       =   &H00000000&
  363.          Height          =   555
  364.          Index           =   46
  365.          Left            =   6400
  366.          MousePointer    =   10  'Up Arrow
  367.          TabIndex        =   67
  368.          Top             =   30
  369.          Width           =   165
  370.       End
  371.       Begin Frame PianoKey 
  372.          BackColor       =   &H00000000&
  373.          DragMode        =   1  'Automatic
  374.          ForeColor       =   &H00000000&
  375.          Height          =   555
  376.          Index           =   44
  377.          Left            =   6160
  378.          MousePointer    =   10  'Up Arrow
  379.          TabIndex        =   66
  380.          Top             =   30
  381.          Width           =   165
  382.       End
  383.       Begin Frame PianoKey 
  384.          BackColor       =   &H00000000&
  385.          DragMode        =   1  'Automatic
  386.          ForeColor       =   &H00000000&
  387.          Height          =   555
  388.          Index           =   42
  389.          Left            =   5920
  390.          MousePointer    =   10  'Up Arrow
  391.          TabIndex        =   65
  392.          Top             =   30
  393.          Width           =   165
  394.       End
  395.       Begin Frame PianoKey 
  396.          BackColor       =   &H00000000&
  397.          DragMode        =   1  'Automatic
  398.          ForeColor       =   &H00000000&
  399.          Height          =   555
  400.          Index           =   39
  401.          Left            =   5440
  402.          MousePointer    =   10  'Up Arrow
  403.          TabIndex        =   64
  404.          Top             =   30
  405.          Width           =   165
  406.       End
  407.       Begin Frame PianoKey 
  408.          BackColor       =   &H00000000&
  409.          DragMode        =   1  'Automatic
  410.          ForeColor       =   &H00000000&
  411.          Height          =   555
  412.          Index           =   37
  413.          Left            =   5200
  414.          MousePointer    =   10  'Up Arrow
  415.          TabIndex        =   63
  416.          Top             =   30
  417.          Width           =   165
  418.       End
  419.       Begin Frame PianoKey 
  420.          BackColor       =   &H00000000&
  421.          DragMode        =   1  'Automatic
  422.          ForeColor       =   &H00000000&
  423.          Height          =   555
  424.          Index           =   34
  425.          Left            =   4720
  426.          MousePointer    =   10  'Up Arrow
  427.          TabIndex        =   62
  428.          Top             =   30
  429.          Width           =   165
  430.       End
  431.       Begin Frame PianoKey 
  432.          BackColor       =   &H00000000&
  433.          DragMode        =   1  'Automatic
  434.          ForeColor       =   &H00000000&
  435.          Height          =   555
  436.          Index           =   32
  437.          Left            =   4480
  438.          MousePointer    =   10  'Up Arrow
  439.          TabIndex        =   61
  440.          Top             =   30
  441.          Width           =   165
  442.       End
  443.       Begin Frame PianoKey 
  444.          BackColor       =   &H00000000&
  445.          DragMode        =   1  'Automatic
  446.          ForeColor       =   &H00000000&
  447.          Height          =   555
  448.          Index           =   30
  449.          Left            =   4240
  450.          MousePointer    =   10  'Up Arrow
  451.          TabIndex        =   60
  452.          Top             =   30
  453.          Width           =   165
  454.       End
  455.       Begin Frame PianoKey 
  456.          BackColor       =   &H00000000&
  457.          DragMode        =   1  'Automatic
  458.          ForeColor       =   &H00000000&
  459.          Height          =   555
  460.          Index           =   27
  461.          Left            =   3760
  462.          MousePointer    =   10  'Up Arrow
  463.          TabIndex        =   59
  464.          Top             =   30
  465.          Width           =   165
  466.       End
  467.       Begin Frame PianoKey 
  468.          BackColor       =   &H00000000&
  469.          DragMode        =   1  'Automatic
  470.          ForeColor       =   &H00000000&
  471.          Height          =   555
  472.          Index           =   25
  473.          Left            =   3520
  474.          MousePointer    =   10  'Up Arrow
  475.          TabIndex        =   58
  476.          Top             =   30
  477.          Width           =   165
  478.       End
  479.       Begin Frame PianoKey 
  480.          BackColor       =   &H00000000&
  481.          DragMode        =   1  'Automatic
  482.          ForeColor       =   &H00000000&
  483.          Height          =   555
  484.          Index           =   22
  485.          Left            =   3040
  486.          MousePointer    =   10  'Up Arrow
  487.          TabIndex        =   57
  488.          Top             =   30
  489.          Width           =   165
  490.       End
  491.       Begin Frame PianoKey 
  492.          BackColor       =   &H00000000&
  493.          DragMode        =   1  'Automatic
  494.          ForeColor       =   &H00000000&
  495.          Height          =   555
  496.          Index           =   20
  497.          Left            =   2800
  498.          MousePointer    =   10  'Up Arrow
  499.          TabIndex        =   56
  500.          Top             =   30
  501.          Width           =   165
  502.       End
  503.       Begin Frame PianoKey 
  504.          BackColor       =   &H00000000&
  505.          DragMode        =   1  'Automatic
  506.          ForeColor       =   &H00000000&
  507.          Height          =   555
  508.          Index           =   18
  509.          Left            =   2560
  510.          MousePointer    =   10  'Up Arrow
  511.          TabIndex        =   55
  512.          Top             =   30
  513.          Width           =   165
  514.       End
  515.       Begin Frame PianoKey 
  516.          BackColor       =   &H00000000&
  517.          DragMode        =   1  'Automatic
  518.          ForeColor       =   &H00000000&
  519.          Height          =   555
  520.          Index           =   15
  521.          Left            =   2080
  522.          MousePointer    =   10  'Up Arrow
  523.          TabIndex        =   54
  524.          Top             =   30
  525.          Width           =   165
  526.       End
  527.       Begin Frame PianoKey 
  528.          BackColor       =   &H00000000&
  529.          DragMode        =   1  'Automatic
  530.          ForeColor       =   &H00000000&
  531.          Height          =   555
  532.          Index           =   13
  533.          Left            =   1840
  534.          MousePointer    =   10  'Up Arrow
  535.          TabIndex        =   53
  536.          Top             =   30
  537.          Width           =   165
  538.       End
  539.       Begin Frame PianoKey 
  540.          BackColor       =   &H00000000&
  541.          DragMode        =   1  'Automatic
  542.          ForeColor       =   &H00000000&
  543.          Height          =   555
  544.          Index           =   10
  545.          Left            =   1360
  546.          MousePointer    =   10  'Up Arrow
  547.          TabIndex        =   52
  548.          Top             =   30
  549.          Width           =   165
  550.       End
  551.       Begin Frame PianoKey 
  552.          BackColor       =   &H00000000&
  553.          DragMode        =   1  'Automatic
  554.          ForeColor       =   &H00000000&
  555.          Height          =   555
  556.          Index           =   8
  557.          Left            =   1120
  558.          MousePointer    =   10  'Up Arrow
  559.          TabIndex        =   51
  560.          Top             =   30
  561.          Width           =   165
  562.       End
  563.       Begin Frame PianoKey 
  564.          BackColor       =   &H00000000&
  565.          DragMode        =   1  'Automatic
  566.          ForeColor       =   &H00000000&
  567.          Height          =   555
  568.          Index           =   6
  569.          Left            =   880
  570.          MousePointer    =   10  'Up Arrow
  571.          TabIndex        =   50
  572.          Top             =   30
  573.          Width           =   165
  574.       End
  575.       Begin Frame PianoKey 
  576.          BackColor       =   &H00000000&
  577.          DragMode        =   1  'Automatic
  578.          ForeColor       =   &H00000000&
  579.          Height          =   555
  580.          Index           =   3
  581.          Left            =   400
  582.          MousePointer    =   10  'Up Arrow
  583.          TabIndex        =   49
  584.          Top             =   30
  585.          Width           =   165
  586.       End
  587.       Begin Frame PianoKey 
  588.          BackColor       =   &H00000000&
  589.          ForeColor       =   &H00000000&
  590.          Height          =   555
  591.          Index           =   1
  592.          Left            =   160
  593.          MousePointer    =   10  'Up Arrow
  594.          TabIndex        =   48
  595.          Top             =   30
  596.          Width           =   165
  597.       End
  598.       Begin Frame PianoKey 
  599.          DragMode        =   1  'Automatic
  600.          Height          =   855
  601.          Index           =   64
  602.          Left            =   8880
  603.          MousePointer    =   10  'Up Arrow
  604.          TabIndex        =   47
  605.          Top             =   0
  606.          Width           =   255
  607.       End
  608.       Begin Frame PianoKey 
  609.          DragMode        =   1  'Automatic
  610.          Height          =   855
  611.          Index           =   62
  612.          Left            =   8640
  613.          MousePointer    =   10  'Up Arrow
  614.          TabIndex        =   46
  615.          Top             =   0
  616.          Width           =   255
  617.       End
  618.       Begin Frame PianoKey 
  619.          DragMode        =   1  'Automatic
  620.          Height          =   855
  621.          Index           =   60
  622.          Left            =   8400
  623.          MousePointer    =   10  'Up Arrow
  624.          TabIndex        =   45
  625.          Top             =   0
  626.          Width           =   255
  627.       End
  628.       Begin Frame PianoKey 
  629.          DragMode        =   1  'Automatic
  630.          Height          =   855
  631.          Index           =   59
  632.          Left            =   8160
  633.          MousePointer    =   10  'Up Arrow
  634.          TabIndex        =   44
  635.          Top             =   0
  636.          Width           =   255
  637.       End
  638.       Begin Frame PianoKey 
  639.          DragMode        =   1  'Automatic
  640.          Height          =   855
  641.          Index           =   57
  642.          Left            =   7920
  643.          MousePointer    =   10  'Up Arrow
  644.          TabIndex        =   43
  645.          Top             =   0
  646.          Width           =   255
  647.       End
  648.       Begin Frame PianoKey 
  649.          DragMode        =   1  'Automatic
  650.          Height          =   855
  651.          Index           =   55
  652.          Left            =   7680
  653.          MousePointer    =   10  'Up Arrow
  654.          TabIndex        =   42
  655.          Top             =   0
  656.          Width           =   255
  657.       End
  658.       Begin Frame PianoKey 
  659.          DragMode        =   1  'Automatic
  660.          Height          =   855
  661.          Index           =   53
  662.          Left            =   7440
  663.          MousePointer    =   10  'Up Arrow
  664.          TabIndex        =   41
  665.          Top             =   0
  666.          Width           =   255
  667.       End
  668.       Begin Frame PianoKey 
  669.          DragMode        =   1  'Automatic
  670.          Height          =   855
  671.          Index           =   52
  672.          Left            =   7200
  673.          MousePointer    =   10  'Up Arrow
  674.          TabIndex        =   40
  675.          Top             =   0
  676.          Width           =   255
  677.       End
  678.       Begin Frame PianoKey 
  679.          DragMode        =   1  'Automatic
  680.          Height          =   855
  681.          Index           =   50
  682.          Left            =   6960
  683.          MousePointer    =   10  'Up Arrow
  684.          TabIndex        =   39
  685.          Top             =   0
  686.          Width           =   255
  687.       End
  688.       Begin Frame PianoKey 
  689.          DragMode        =   1  'Automatic
  690.          Height          =   855
  691.          Index           =   48
  692.          Left            =   6720
  693.          MousePointer    =   10  'Up Arrow
  694.          TabIndex        =   38
  695.          Top             =   0
  696.          Width           =   255
  697.       End
  698.       Begin Frame PianoKey 
  699.          DragMode        =   1  'Automatic
  700.          Height          =   855
  701.          Index           =   47
  702.          Left            =   6480
  703.          MousePointer    =   10  'Up Arrow
  704.          TabIndex        =   37
  705.          Top             =   0
  706.          Width           =   255
  707.       End
  708.       Begin Frame PianoKey 
  709.          DragMode        =   1  'Automatic
  710.          Height          =   855
  711.          Index           =   45
  712.          Left            =   6240
  713.          MousePointer    =   10  'Up Arrow
  714.          TabIndex        =   36
  715.          Top             =   0
  716.          Width           =   255
  717.       End
  718.       Begin Frame PianoKey 
  719.          DragMode        =   1  'Automatic
  720.          Height          =   855
  721.          Index           =   43
  722.          Left            =   6000
  723.          MousePointer    =   10  'Up Arrow
  724.          TabIndex        =   35
  725.          Top             =   0
  726.          Width           =   255
  727.       End
  728.       Begin Frame PianoKey 
  729.          DragMode        =   1  'Automatic
  730.          Height          =   855
  731.          Index           =   41
  732.          Left            =   5760
  733.          MousePointer    =   10  'Up Arrow
  734.          TabIndex        =   34
  735.          Top             =   0
  736.          Width           =   255
  737.       End
  738.       Begin Frame PianoKey 
  739.          DragMode        =   1  'Automatic
  740.          Height          =   855
  741.          Index           =   40
  742.          Left            =   5520
  743.          MousePointer    =   10  'Up Arrow
  744.          TabIndex        =   33
  745.          Top             =   0
  746.          Width           =   255
  747.       End
  748.       Begin Frame PianoKey 
  749.          DragMode        =   1  'Automatic
  750.          Height          =   855
  751.          Index           =   38
  752.          Left            =   5280
  753.          MousePointer    =   10  'Up Arrow
  754.          TabIndex        =   32
  755.          Top             =   0
  756.          Width           =   255
  757.       End
  758.       Begin Frame PianoKey 
  759.          DragMode        =   1  'Automatic
  760.          Height          =   855
  761.          Index           =   36
  762.          Left            =   5040
  763.          MousePointer    =   10  'Up Arrow
  764.          TabIndex        =   31
  765.          Top             =   0
  766.          Width           =   255
  767.       End
  768.       Begin Frame PianoKey 
  769.          DragMode        =   1  'Automatic
  770.          Height          =   855
  771.          Index           =   35
  772.          Left            =   4800
  773.          MousePointer    =   10  'Up Arrow
  774.          TabIndex        =   30
  775.          Top             =   0
  776.          Width           =   255
  777.       End
  778.       Begin Frame PianoKey 
  779.          DragMode        =   1  'Automatic
  780.          Height          =   855
  781.          Index           =   33
  782.          Left            =   4560
  783.          MousePointer    =   10  'Up Arrow
  784.          TabIndex        =   29
  785.          Top             =   0
  786.          Width           =   255
  787.       End
  788.       Begin Frame PianoKey 
  789.          DragMode        =   1  'Automatic
  790.          Height          =   855
  791.          Index           =   31
  792.          Left            =   4320
  793.          MousePointer    =   10  'Up Arrow
  794.          TabIndex        =   28
  795.          Top             =   0
  796.          Width           =   255
  797.       End
  798.       Begin Frame PianoKey 
  799.          DragMode        =   1  'Automatic
  800.          Height          =   855
  801.          Index           =   29
  802.          Left            =   4080
  803.          MousePointer    =   10  'Up Arrow
  804.          TabIndex        =   27
  805.          Top             =   0
  806.          Width           =   255
  807.       End
  808.       Begin Frame PianoKey 
  809.          DragMode        =   1  'Automatic
  810.          Height          =   855
  811.          Index           =   28
  812.          Left            =   3840
  813.          MousePointer    =   10  'Up Arrow
  814.          TabIndex        =   26
  815.          Top             =   0
  816.          Width           =   255
  817.       End
  818.       Begin Frame PianoKey 
  819.          DragMode        =   1  'Automatic
  820.          Height          =   855
  821.          Index           =   26
  822.          Left            =   3600
  823.          MousePointer    =   10  'Up Arrow
  824.          TabIndex        =   25
  825.          Top             =   0
  826.          Width           =   255
  827.       End
  828.       Begin Frame PianoKey 
  829.          DragMode        =   1  'Automatic
  830.          Height          =   855
  831.          Index           =   24
  832.          Left            =   3360
  833.          MousePointer    =   10  'Up Arrow
  834.          TabIndex        =   24
  835.          Top             =   0
  836.          Width           =   255
  837.       End
  838.       Begin Frame PianoKey 
  839.          DragMode        =   1  'Automatic
  840.          Height          =   855
  841.          Index           =   23
  842.          Left            =   3120
  843.          MousePointer    =   10  'Up Arrow
  844.          TabIndex        =   23
  845.          Top             =   0
  846.          Width           =   255
  847.       End
  848.       Begin Frame PianoKey 
  849.          DragMode        =   1  'Automatic
  850.          Height          =   855
  851.          Index           =   21
  852.          Left            =   2880
  853.          MousePointer    =   10  'Up Arrow
  854.          TabIndex        =   22
  855.          Top             =   0
  856.          Width           =   255
  857.       End
  858.       Begin Frame PianoKey 
  859.          DragMode        =   1  'Automatic
  860.          Height          =   855
  861.          Index           =   19
  862.          Left            =   2640
  863.          MousePointer    =   10  'Up Arrow
  864.          TabIndex        =   21
  865.          Top             =   0
  866.          Width           =   255
  867.       End
  868.       Begin Frame PianoKey 
  869.          DragMode        =   1  'Automatic
  870.          Height          =   855
  871.          Index           =   17
  872.          Left            =   2400
  873.          MousePointer    =   10  'Up Arrow
  874.          TabIndex        =   20
  875.          Top             =   0
  876.          Width           =   255
  877.       End
  878.       Begin Frame PianoKey 
  879.          DragMode        =   1  'Automatic
  880.          Height          =   855
  881.          Index           =   16
  882.          Left            =   2160
  883.          MousePointer    =   10  'Up Arrow
  884.          TabIndex        =   19
  885.          Top             =   0
  886.          Width           =   255
  887.       End
  888.       Begin Frame PianoKey 
  889.          DragMode        =   1  'Automatic
  890.          Height          =   855
  891.          Index           =   14
  892.          Left            =   1920
  893.          MousePointer    =   10  'Up Arrow
  894.          TabIndex        =   18
  895.          Top             =   0
  896.          Width           =   255
  897.       End
  898.       Begin Frame PianoKey 
  899.          DragMode        =   1  'Automatic
  900.          Height          =   855
  901.          Index           =   12
  902.          Left            =   1680
  903.          MousePointer    =   10  'Up Arrow
  904.          TabIndex        =   17
  905.          Top             =   0
  906.          Width           =   255
  907.       End
  908.       Begin Frame PianoKey 
  909.          DragMode        =   1  'Automatic
  910.          Height          =   855
  911.          Index           =   11
  912.          Left            =   1440
  913.          MousePointer    =   10  'Up Arrow
  914.          TabIndex        =   16
  915.          Top             =   0
  916.          Width           =   255
  917.       End
  918.       Begin Frame PianoKey 
  919.          DragMode        =   1  'Automatic
  920.          Height          =   855
  921.          Index           =   9
  922.          Left            =   1200
  923.          MousePointer    =   10  'Up Arrow
  924.          TabIndex        =   15
  925.          Top             =   0
  926.          Width           =   255
  927.       End
  928.       Begin Frame PianoKey 
  929.          DragMode        =   1  'Automatic
  930.          Height          =   855
  931.          Index           =   7
  932.          Left            =   960
  933.          MousePointer    =   10  'Up Arrow
  934.          TabIndex        =   14
  935.          Top             =   0
  936.          Width           =   255
  937.       End
  938.       Begin Frame PianoKey 
  939.          DragMode        =   1  'Automatic
  940.          Height          =   855
  941.          Index           =   5
  942.          Left            =   720
  943.          MousePointer    =   10  'Up Arrow
  944.          TabIndex        =   13
  945.          Top             =   0
  946.          Width           =   255
  947.       End
  948.       Begin Frame PianoKey 
  949.          DragMode        =   1  'Automatic
  950.          Height          =   855
  951.          Index           =   4
  952.          Left            =   480
  953.          MousePointer    =   10  'Up Arrow
  954.          TabIndex        =   12
  955.          Top             =   0
  956.          Width           =   255
  957.       End
  958.       Begin Frame PianoKey 
  959.          BackColor       =   &H00FFFFFF&
  960.          DragIcon        =   PIANO2.FRX:0504
  961.          DragMode        =   1  'Automatic
  962.          Height          =   855
  963.          Index           =   0
  964.          Left            =   0
  965.          MousePointer    =   10  'Up Arrow
  966.          TabIndex        =   11
  967.          Top             =   0
  968.          Width           =   255
  969.       End
  970.       Begin Frame PianoKey 
  971.          BackColor       =   &H00FFFFFF&
  972.          DragMode        =   1  'Automatic
  973.          Height          =   855
  974.          Index           =   2
  975.          Left            =   210
  976.          MousePointer    =   10  'Up Arrow
  977.          TabIndex        =   75
  978.          Top             =   0
  979.          Width           =   285
  980.       End
  981.    End
  982.    Begin Menu File 
  983.       Caption         =   "&File"
  984.       Begin Menu Exit 
  985.          Caption         =   "E&xit"
  986.       End
  987.    End
  988.    Begin Menu MIDI 
  989.       Caption         =   "&MIDI"
  990.       Begin Menu MIDISetup 
  991.          Caption         =   "MIDI &Setup..."
  992.       End
  993.    End
  994. End
  995. Option Explicit
  996.  
  997. Dim NoteCatchCount As Integer
  998. Dim NoteOnCatcher(1024) As Integer
  999.  
  1000. '
  1001. ' While recording this variable contains the recording
  1002. ' start time
  1003. '
  1004. Dim startTime As Long
  1005.  
  1006. '
  1007. ' Index into notes array
  1008. '
  1009. Dim note As Integer
  1010. '
  1011.  
  1012. Sub ComboPatch_Click ()
  1013.     ' Sets the Patch for the current Midi Channel Out
  1014.     MidiPatch(MidiChannelOut) = ComboPatch.ListIndex
  1015.  
  1016.     'Patch Midi Out routine
  1017.     MIDIOutput1.Message = PROGRAM_CHANGE + MidiChannelOut
  1018.     MIDIOutput1.Data1 = MidiPatch(MidiChannelOut)
  1019.     MIDIOutput1.Data2 = 0
  1020.     MIDIOutput1.Time = 0
  1021.     MIDIOutput1.Action = MIDIOUT_SEND
  1022. End Sub
  1023.  
  1024. Sub Exit_Click ()
  1025.     ' Stop the MIDI In
  1026.     MIDIInput1.Action = MIDIIN_STOP
  1027.     
  1028.     ' Close MIDI In
  1029.     MIDIInput1.Action = MIDIIN_CLOSE
  1030.  
  1031.     
  1032.     ' Close MIDI Out
  1033.     MIDIOutput1.Action = MIDIOUT_CLOSE
  1034.  
  1035.     End
  1036. End Sub
  1037.  
  1038. Sub Form_Load ()
  1039.     Dim n As Integer
  1040.  
  1041.     Screen.MousePointer = 11
  1042.     Piano.Left = 0
  1043.     Piano.Top = 0
  1044.     
  1045.     ' General MIDI patches
  1046.     ComboPatch.AddItem "Acoustic Grand Piano"
  1047.     ComboPatch.AddItem "Bright Acoustic Piano"
  1048.     ComboPatch.AddItem "Electric Grand Piano"
  1049.     ComboPatch.AddItem "Honkytonk Piano"
  1050.     ComboPatch.AddItem "Rhodes Piano"
  1051.     ComboPatch.AddItem "Chorus Piano"
  1052.     ComboPatch.AddItem "Harpsichord"
  1053.     ComboPatch.AddItem "Clavinet"
  1054.     ComboPatch.AddItem "Celesta"
  1055.     ComboPatch.AddItem "Glockenspiel"
  1056.     ComboPatch.AddItem "Music Box"
  1057.     ComboPatch.AddItem "Vibraphone"
  1058.     ComboPatch.AddItem "Marimba"
  1059.     ComboPatch.AddItem "Xylophone"
  1060.     ComboPatch.AddItem "Tubular Bells"
  1061.     ComboPatch.AddItem "Dulcimer"
  1062.     ComboPatch.AddItem "Hammond Organ"
  1063.     ComboPatch.AddItem "Percuss. Organ"
  1064.     ComboPatch.AddItem "Rock Organ"
  1065.     ComboPatch.AddItem "Church Organ"
  1066.     ComboPatch.AddItem "Reed Organ"
  1067.     ComboPatch.AddItem "Accordion"
  1068.     ComboPatch.AddItem "Harmonica"
  1069.     ComboPatch.AddItem "Tango Accordion"
  1070.     ComboPatch.AddItem "Acoustic Guitar (nylon)"
  1071.     ComboPatch.AddItem "Acoustic Guitar (steel)"
  1072.     ComboPatch.AddItem "Electric Guitar (jazz)"
  1073.     ComboPatch.AddItem "Electric Guitar (clean)"
  1074.     ComboPatch.AddItem "Electric Guitar (muted)"
  1075.     ComboPatch.AddItem "Overdriven Guitar"
  1076.     ComboPatch.AddItem "Distortion Guitar"
  1077.     ComboPatch.AddItem "Guitar Harmonics"
  1078.     ComboPatch.AddItem "Acoustic Bass"
  1079.     ComboPatch.AddItem "Electric Bass (finger)"
  1080.     ComboPatch.AddItem "Electric Bass (pick)"
  1081.     ComboPatch.AddItem "Fretless Bass"
  1082.     ComboPatch.AddItem "Slap Bass 1"
  1083.     ComboPatch.AddItem "Slap Bass 2"
  1084.     ComboPatch.AddItem "Synth Bass 1"
  1085.     ComboPatch.AddItem "Synth Bass 2"
  1086.     ComboPatch.AddItem "Violin"
  1087.     ComboPatch.AddItem "Viola"
  1088.     ComboPatch.AddItem "Cello"
  1089.     ComboPatch.AddItem "Contra Bass"
  1090.     ComboPatch.AddItem "Tremolo Strings"
  1091.     ComboPatch.AddItem "Pizzicato Strings"
  1092.     ComboPatch.AddItem "Orchestral Harp"
  1093.     ComboPatch.AddItem "Timpani"
  1094.     ComboPatch.AddItem "String Ensemble 1"
  1095.     ComboPatch.AddItem "String Ensemble 2"
  1096.     ComboPatch.AddItem "Synth Strings 1"
  1097.     ComboPatch.AddItem "Synth Strings 2"
  1098.     ComboPatch.AddItem "Choir Aahs"
  1099.     ComboPatch.AddItem "Voice Oohs"
  1100.     ComboPatch.AddItem "Synth Voice"
  1101.     ComboPatch.AddItem "Orchestra Hit"
  1102.     ComboPatch.AddItem "Trumpet"
  1103.     ComboPatch.AddItem "Trombone"
  1104.     ComboPatch.AddItem "Tuba"
  1105.     ComboPatch.AddItem "Muted Trumpet"
  1106.     ComboPatch.AddItem "French Horn"
  1107.     ComboPatch.AddItem "Brass Section"
  1108.     ComboPatch.AddItem "Synth Brass 1"
  1109.     ComboPatch.AddItem "Synth Brass 2"
  1110.     ComboPatch.AddItem "Soprano Sax"
  1111.     ComboPatch.AddItem "Alto Sax"
  1112.     ComboPatch.AddItem "Tenor Sax"
  1113.     ComboPatch.AddItem "Baritone Sax"
  1114.     ComboPatch.AddItem "Oboe"
  1115.     ComboPatch.AddItem "English Horn"
  1116.     ComboPatch.AddItem "Bassoon"
  1117.     ComboPatch.AddItem "Clarinet"
  1118.     ComboPatch.AddItem "Piccolo"
  1119.     ComboPatch.AddItem "Flute"
  1120.     ComboPatch.AddItem "Recorder"
  1121.     ComboPatch.AddItem "Pan Flute"
  1122.     ComboPatch.AddItem "Bottle Blow"
  1123.     ComboPatch.AddItem "Shaku"
  1124.     ComboPatch.AddItem "Whistle"
  1125.     ComboPatch.AddItem "Ocarina"
  1126.     ComboPatch.AddItem "Lead 1 (square)"
  1127.     ComboPatch.AddItem "Lead 2 (saw tooth)"
  1128.     ComboPatch.AddItem "Lead 3 (calliope lead)"
  1129.     ComboPatch.AddItem "Lead 4 (chiff lead)"
  1130.     ComboPatch.AddItem "Lead 5 (charang)"
  1131.     ComboPatch.AddItem "Lead 6 (voice)"
  1132.     ComboPatch.AddItem "Lead 7 (fifths)"
  1133.     ComboPatch.AddItem "Lead 8 (bass + lead)"
  1134.     ComboPatch.AddItem "Pad 1 (new age)"
  1135.     ComboPatch.AddItem "Pad 2 (warm)"
  1136.     ComboPatch.AddItem "Pad 3 (poly synth)"
  1137.     ComboPatch.AddItem "Pad 4 (choir)"
  1138.     ComboPatch.AddItem "Pad 5 (bowed)"
  1139.     ComboPatch.AddItem "Pad 6 (metallic)"
  1140.     ComboPatch.AddItem "Pad 7 (halo)"
  1141.     ComboPatch.AddItem "Pad 8 (sweep)"
  1142.     ComboPatch.AddItem "FX 1 (rain)"
  1143.     ComboPatch.AddItem "FX 2 (sound track)"
  1144.     ComboPatch.AddItem "FX 3 (crystal)"
  1145.     ComboPatch.AddItem "FX 4 (atmo - sphere)"
  1146.     ComboPatch.AddItem "FX 5 (bright)"
  1147.     ComboPatch.AddItem "FX 6 (goblins)"
  1148.     ComboPatch.AddItem "FX 7 (echoes)"
  1149.     ComboPatch.AddItem "FX 8 (sci-fi)"
  1150.     ComboPatch.AddItem "Sitar"
  1151.     ComboPatch.AddItem "Banjo"
  1152.     ComboPatch.AddItem "Shamisen"
  1153.     ComboPatch.AddItem "Koto"
  1154.     ComboPatch.AddItem "Kalimba"
  1155.     ComboPatch.AddItem "Bagpipe"
  1156.     ComboPatch.AddItem "Fiddle"
  1157.     ComboPatch.AddItem "Shanai"
  1158.     ComboPatch.AddItem "Tinkle Bell"
  1159.     ComboPatch.AddItem "Agogo"
  1160.     ComboPatch.AddItem "Steel Drums"
  1161.     ComboPatch.AddItem "Wood block"
  1162.     ComboPatch.AddItem "Taiko Drum"
  1163.     ComboPatch.AddItem "Melodic Tom"
  1164.     ComboPatch.AddItem "Synth Drum"
  1165.     ComboPatch.AddItem "Reverse Cymbal"
  1166.     ComboPatch.AddItem "Guitar Fret Noise"
  1167.     ComboPatch.AddItem "Breath Noise"
  1168.     ComboPatch.AddItem "Seashore"
  1169.     ComboPatch.AddItem "Bird Tweet"
  1170.     ComboPatch.AddItem "Telephone Ring"
  1171.     ComboPatch.AddItem "Helicopter"
  1172.     ComboPatch.AddItem "Applause"
  1173.     ComboPatch.AddItem "Gunshot"
  1174.     ComboPatch.ListIndex = 0
  1175.  
  1176.     MidiChannelOut = 0
  1177.     HSliderMIDIChannel.Value = 0
  1178.     HSliderOctave.Value = 3
  1179.     HSliderVolume.Value = 100
  1180.     KnobPan.Value = 64
  1181.     Screen.MousePointer = 0
  1182.  
  1183.     For n = 1 To 64
  1184.     PianoKey(n).DragIcon = PianoKey(0).DragIcon
  1185.     Next
  1186.  
  1187.     Piano.Show
  1188.     MidiSetupForm.Show MODAL
  1189.  
  1190. End Sub
  1191.  
  1192. Sub Form_Unload (Cancel As Integer)
  1193.     ' Stop the MIDI In
  1194.     MIDIInput1.Action = MIDIIN_STOP
  1195.     
  1196.     ' Close MIDI In
  1197.     MIDIInput1.Action = MIDIIN_CLOSE
  1198.  
  1199.     
  1200.     ' Close MIDI Out
  1201.     MIDIOutput1.Action = MIDIOUT_CLOSE
  1202.  
  1203.     End
  1204. End Sub
  1205.  
  1206. Sub HSliderMIDIChannel_Change ()
  1207.     ' Change Midi Channel to Vscroll1 value
  1208.     MidiChannelOut = HSliderMIDIChannel.Value
  1209.  
  1210.     ' Display new channel
  1211.     MidiChannelOutLabel.Caption = Str$(MidiChannelOut + 1)
  1212.  
  1213.     ' Sets the Patch & Volume for the current Midi Channel Out
  1214.     ComboPatch.ListIndex = MidiPatch(MidiChannelOut)
  1215.     HSliderVolume.Value = MidiVolume(MidiChannelOut)
  1216.     KnobPan.Value = MidiPan(MidiChannelOut)
  1217.     HSliderOctave.Value = Octave(MidiChannelOut) / 12
  1218. End Sub
  1219.  
  1220. Sub HSliderMIDIChannel_Scroll ()
  1221.     ' Change Midi Channel to Vscroll1 value
  1222.     MidiChannelOut = HSliderMIDIChannel.Value
  1223.  
  1224.     ' Display new channel
  1225.     MidiChannelOutLabel.Caption = Str$(MidiChannelOut + 1)
  1226.  
  1227.     ' Sets the Patch & Volume for the current Midi Channel Out
  1228.     ComboPatch.ListIndex = MidiPatch(MidiChannelOut)
  1229.     HSliderVolume.Value = MidiVolume(MidiChannelOut)
  1230.     KnobPan.Value = MidiPan(MidiChannelOut)
  1231.     HSliderOctave.Value = Octave(MidiChannelOut) / 12
  1232.  
  1233. End Sub
  1234.  
  1235. Sub HSliderOctave_Change ()
  1236.     LabelOctave.Caption = Str$(HSliderOctave.Value)
  1237.     Octave(MidiChannelOut) = (HSliderOctave.Value * 12)
  1238. End Sub
  1239.  
  1240. Sub HSliderOctave_Scroll ()
  1241.     LabelOctave.Caption = Str$(HSliderOctave.Value)
  1242.     Octave(MidiChannelOut) = (HSliderOctave.Value * 12)
  1243. End Sub
  1244.  
  1245. Sub HSliderVolume_Change ()
  1246.     MidiVelocity = HSliderVolume.Value
  1247.     MidiVolume(MidiChannelOut) = HSliderVolume.Value
  1248.     LabelVolume.Caption = Str$(MidiVelocity)
  1249. End Sub
  1250.  
  1251. Sub HSliderVolume_Scroll ()
  1252.     MidiVelocity = HSliderVolume.Value
  1253.     MidiVolume(MidiChannelOut) = HSliderVolume.Value
  1254.     LabelVolume.Caption = Str$(MidiVelocity)
  1255. End Sub
  1256.  
  1257. Sub KnobPan_Change ()
  1258.     MidiPan(MidiChannelOut) = KnobPan.Value
  1259.  
  1260.     'Pan Midi Out routine
  1261.     MIDIOutput1.Message = CONTROLLER_CHANGE + MidiChannelOut
  1262.     MIDIOutput1.Data1 = PAN
  1263.     MIDIOutput1.Data2 = MidiPan(MidiChannelOut)
  1264.     MIDIOutput1.Time = 0
  1265.     MIDIOutput1.Action = MIDIOUT_SEND
  1266. End Sub
  1267.  
  1268. Sub KnobPan_Scroll ()
  1269.     MidiPan(MidiChannelOut) = KnobPan.Value
  1270.  
  1271.     'Pan Midi Out routine
  1272.     MIDIOutput1.Message = CONTROLLER_CHANGE + MidiChannelOut
  1273.     MIDIOutput1.Data1 = PAN
  1274.     MIDIOutput1.Data2 = MidiPan(MidiChannelOut)
  1275.     MIDIOutput1.Time = 0
  1276.     MIDIOutput1.Action = MIDIOUT_SEND
  1277. End Sub
  1278.  
  1279. Sub MIDIInput1_Error (ErrorCode As Integer, ErrorMessage As String)
  1280.     MsgBox ErrorMessage
  1281. End Sub
  1282.  
  1283. Sub MIDIInput1_Message ()
  1284.     Dim InMessage As Integer
  1285.     Dim InData1 As Integer
  1286.     Dim InData2 As Integer
  1287.  
  1288.     '
  1289.     ' The MIDI1.VBX will receive and time stamp in-coming MIDI data very
  1290.     ' fast, but it takes VB a lot of time to fire this Message event. If
  1291.     ' you need to process MIDI data in real-time, each time this Message
  1292.     ' event fires, you should take all the pending messages.  One way to
  1293.     ' do this is by using a Do While MIDIInput2.MessageCount > 0
  1294.     ' This do while loop allows you to take all the messages that are
  1295.     ' waiting in the message queue.
  1296.  
  1297.     Do While MIDIInput1.MessageCount > 0
  1298.     '
  1299.     'This is in-coming MIDI data
  1300.     '
  1301.     InMessage = MIDIInput1.Message
  1302.     InData1 = MIDIInput1.Data1
  1303.     InData2 = MIDIInput1.Data2
  1304.  
  1305.     '
  1306.     'Now we are going to prepare the MIDI data that just came in to
  1307.     'be ready to go right back out the MIDI OUT
  1308.     '
  1309.     MIDIOutput1.Message = InMessage
  1310.     MIDIOutput1.Data1 = InData1
  1311.     MIDIOutput1.Data2 = InData2
  1312.     
  1313.     Select Case InMessage
  1314.     '
  1315.     ' NOTE_ON, NOTE_OFF, PROGRAM_CHANGE, TOTAL_MIDI_CHANNELS
  1316.     ' are all constants from the MIDCONST.BAS file.  Using constants in
  1317.     ' the MIDCONST.BAS file will allow you to not have to work with
  1318.     ' confusing codes.
  1319.     '
  1320.     ' Check to see if the in-coming MIDI Message was a NOTE_ON from the
  1321.     ' currently selected MIDI channel.
  1322.     '
  1323.     ' We can only display 64 notes on our graphic piano.  Check to see if
  1324.     ' InData1 (which is the actual MIDI note be played) can be shown on
  1325.     ' the graphic piano display.
  1326.     '
  1327.     ' Using HSliderOctave, the Octave(MidiChannelOut) is set.  This
  1328.     ' allows you to slide the octave display up and down for disaply
  1329.     ' notes that would otherwise not be able to appear on the graphic
  1330.     ' piano display.
  1331.     '
  1332.        Case NOTE_ON + MidiChannelOut
  1333.         If InData1 <= 64 + Octave(MidiChannelOut) Then
  1334.             '
  1335.             ' Some MIDI manufactures turn MIDI notes off by sending a MIDI NOTE ON
  1336.             ' with a velocity = 0.  InData2 is the note velocity.  If it is greater
  1337.             ' than 0 then it truly is a note on.  If it is, then push down the
  1338.             ' graphic key on the piano.
  1339.             '
  1340.             ' If InData2 is equal to zero, then release the graphic key on the piano
  1341.             ' because it is actually a note off.
  1342.             '
  1343.             If InData2 > 0 Then
  1344.             '
  1345.             ' Push down the graphic key on the piano
  1346.             '
  1347.             'Piano.PianoKey(InData1 - Octave(MidiChannelOut)).BevelOuter = 0
  1348.             Else
  1349.             ' Release the graphic key on the piano
  1350.             '
  1351.             'Piano.PianoKey(InData1 - Octave(MidiChannelOut)).BevelOuter = 2
  1352.             End If
  1353.         End If
  1354.         '
  1355.         'Tell MIDIOutput1 to send the MIDI data
  1356.         '
  1357.         MIDIOutput1.Action = MIDIOUT_SEND
  1358.  
  1359.         '
  1360.         ' MIDI NOTE OFF Event received
  1361.         '
  1362.         Case NOTE_OFF + MidiChannelOut
  1363.         If InData1 <= 64 + Octave(MidiChannelOut) Then
  1364.             '
  1365.             ' Release the graphic key on the piano
  1366.             '
  1367.             'Piano.PianoKey(InData1 - Octave(MidiChannelOut)).BevelOuter = 2
  1368.         End If
  1369.         '
  1370.         'Tell MIDIOutput1 to send the MIDI data
  1371.         '
  1372.         MIDIOutput1.Action = MIDIOUT_SEND
  1373.  
  1374.         '
  1375.         ' Patch Program Change received
  1376.         '
  1377.         Case PROGRAM_CHANGE + MidiChannelOut
  1378.         '
  1379.         ' Patches (organ, piano, horn, etc.) are changed by sending
  1380.         ' a PROGRAM_CHANGE.  If we received a PROGRAM_CHANGE on the
  1381.         ' current MIDI channel from an external MIDI device, we
  1382.         ' will update the patch name on the screen and send the patch
  1383.         ' change out the MIDI Out.
  1384.         '
  1385.          ComboPatch.ListIndex = MIDIOutput1.Data1
  1386.  
  1387.         '
  1388.         'Controller Change received
  1389.         '
  1390.         Case CONTROLLER_CHANGE + MidiChannelOut
  1391.         Select Case InData1
  1392.             Case MAIN_VOLUME
  1393.             HSliderVolume.Value = InData2
  1394.             Case PAN
  1395.             KnobPan.Value = InData2
  1396.         End Select
  1397.         
  1398.         Case Else
  1399.         '
  1400.         'Tell MIDIOutput1 to send the MIDI data
  1401.         '
  1402.         MIDIOutput1.Action = MIDIOUT_SEND
  1403.         
  1404.     End Select
  1405.  
  1406.     '
  1407.     'Remove the MIDI data from the MIDI IN queue
  1408.     '
  1409.     MIDIInput1.Action = MIDIIN_REMOVE
  1410.     Loop
  1411. End Sub
  1412.  
  1413. Sub MIDISetup_Click ()
  1414.     MidiSetupForm.Show MODAL
  1415. End Sub
  1416.  
  1417. Sub PanelWhite_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)
  1418.     Dim nn As Integer
  1419.     For nn = 0 To NoteCatchCount - 1
  1420.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1421.     MIDIOutput1.Data2 = 0
  1422.     MIDIOutput1.Data1 = NoteOnCatcher(nn)
  1423.     MIDIOutput1.Time = 0
  1424.     MIDIOutput1.Action = MIDIOUT_SEND
  1425.  
  1426.     'Piano.PianoKey(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BevelOuter = 2
  1427.     Next nn
  1428.  
  1429.     NoteCatchCount = 0
  1430. End Sub
  1431.  
  1432. Sub PanelWhite_DragOver (Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)
  1433.     Dim MIDIMessage As Integer
  1434.     Dim MIDINoteOut As Integer
  1435.  
  1436.     MIDINoteOut = Index + Octave(MidiChannelOut)
  1437.  
  1438.     'If still on same note, discard
  1439.     If NoteCatchCount > 0 Then
  1440.        If NoteOnCatcher(NoteCatchCount - 1) = MIDINoteOut Then
  1441.         Exit Sub
  1442.        End If
  1443.     End If
  1444.  
  1445.     'Piano.PianoKey(Index).BevelOuter = 0
  1446.     
  1447.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1448.     MIDIOutput1.Data2 = MidiVelocity
  1449.     MIDIOutput1.Data1 = MIDINoteOut
  1450.     MIDIOutput1.Time = 0
  1451.     MIDIOutput1.Action = MIDIOUT_SEND
  1452.  
  1453.     'Since drag/drop is being used, we must keep track of the note being
  1454.     'played.
  1455.     NoteOnCatcher(NoteCatchCount) = MIDINoteOut
  1456.     If NoteCatchCount < 750 Then
  1457.     NoteCatchCount = NoteCatchCount + 1
  1458.     End If
  1459.  
  1460. End Sub
  1461.  
  1462. Sub PianoKey_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)
  1463.     Dim nn As Integer
  1464.     For nn = 0 To NoteCatchCount - 1
  1465.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1466.     MIDIOutput1.Data2 = 0
  1467.     MIDIOutput1.Data1 = NoteOnCatcher(nn)
  1468.     MIDIOutput1.Time = 0
  1469.     MIDIOutput1.Action = MIDIOUT_SEND
  1470.  
  1471.     Select Case (NoteOnCatcher(nn) - Octave(MidiChannelOut)) Mod 12
  1472.         Case Is = 0, 2, 4, 5, 7, 9, 11
  1473.         Piano.PianoKey(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BackColor = WHITE
  1474.         Case Is = 1, 3, 6, 8, 10
  1475.         Piano.PianoKey(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BackColor = BLACK
  1476.     End Select
  1477.     Next nn
  1478.  
  1479.     NoteCatchCount = 0
  1480.  
  1481. End Sub
  1482.  
  1483. Sub PianoKey_DragOver (Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)
  1484.     Dim MIDIMessage As Integer
  1485.     Dim MIDINoteOut As Integer
  1486.  
  1487.     MIDINoteOut = Index + Octave(MidiChannelOut)
  1488.  
  1489.     'If still on same note, discard
  1490.     If NoteCatchCount > 0 Then
  1491.        If NoteOnCatcher(NoteCatchCount - 1) = MIDINoteOut Then
  1492.         Exit Sub
  1493.        End If
  1494.     End If
  1495.  
  1496.     Select Case (Index Mod 12)
  1497.     Case Is = 0, 2, 4, 5, 7, 9, 11
  1498.         Piano.PianoKey(Index).BackColor = YELLOW
  1499.     Case Is = 1, 3, 6, 8, 10
  1500.         Piano.PianoKey(Index).BackColor = CYAN
  1501.     End Select
  1502.     
  1503.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1504.     MIDIOutput1.Data2 = MidiVelocity
  1505.     MIDIOutput1.Data1 = MIDINoteOut
  1506.     MIDIOutput1.Time = 0
  1507.     MIDIOutput1.Action = MIDIOUT_SEND
  1508.  
  1509.     'Since drag/drop is being used, we must keep track of the note being
  1510.     'played.
  1511.     NoteOnCatcher(NoteCatchCount) = MIDINoteOut
  1512.     If NoteCatchCount < 750 Then
  1513.     NoteCatchCount = NoteCatchCount + 1
  1514.     End If
  1515.  
  1516.  
  1517. End Sub
  1518.  
  1519.